package com.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.EmployeeBean;
import com.project.mapper.IDeptMapper;
import com.project.mapper.IEmployeeMapper;
import com.project.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class EmployeeService implements IEmployeeService {
    @Autowired
    private IEmployeeMapper employeeMapper;
    @Autowired
    private IDeptMapper deptMapper;

    @Override
    public void add(EmployeeBean emBean) {
        employeeMapper.insert(emBean);
    }

    @Override
    public IPage<EmployeeBean> findByItem(Integer pageNO, String deptName, String name) {
        return employeeMapper.findByItem(new Page(pageNO,3),deptName,name);
    }

    @Override
    public EmployeeBean findById(Integer id) {
        return null;
    }
}
